FIND_PROGRAM(APXS_BIN NAMES apxs apxs2
             PATH_SUFFIXES httpd apache apache2)

if(APXS_BIN)
  EXECUTE_PROCESS(COMMAND ${APXS_BIN} -q INCLUDEDIR OUTPUT_VARIABLE APXS_INCLUDE_DIR)
  EXECUTE_PROCESS(COMMAND ${APXS_BIN} -q LIBEXECDIR OUTPUT_VARIABLE APXS_MODULE_DIR )
  #message(WARNING "APXS was found ${AXPS_INCLUDE_DIR}")
else(APXS_BIN)
  # message(WARNING "APXS not found")

endif(APXS_BIN)


set(APACHE_INCLUDE_DIRS ${APXS_INCLUDE_DIR})
set(APACHE_MODULE_DIRS ${APXS_MODULE_DIR})


include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(APXS DEFAULT_MSG APXS_BIN APXS_INCLUDE_DIR APXS_MODULE_DIR)
mark_as_advanced(APXS_BIN APXS_INCLUDE_DIR APXS_MODULE_DIR)



